package com.eagle.web.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestHeader;

@ControllerAdvice(assignableTypes = HelloWorldController.class)
public class HelloWorldControllerAdvice {
	@ModelAttribute("acceptLanguage")
	public String acceptLanguage(@RequestHeader("Accept-Language") String acceptLanguage){
		return acceptLanguage;
	}

	@ModelAttribute("jsessionId")
	public String jsessionId(@CookieValue(value = "JSESSIONID",required = false) String jsessionId){
		return jsessionId;
	}

	@ModelAttribute("message")
	public String message(){
		return "Hello,World";
	}
}
